import request from '@/utils/request'
export function getAffairsList (groupid) {
  return request({
    url: '/Affairs/getAffairsList',
    method: 'get',
    params: {
      groupid: groupid
    }
  })
}

export function getLeaderFiles (groupid) {
  return request({
    url: '/LeaderFiles/getLeaderFiles',
    method: 'get',
    params: {
      groupid: groupid
    }
  })
}

export function addAffairs (form) {
  return request({
    url: '/Affairs/addAffairs',
    method: 'post',
    data: form
  })
}

export function addSendAffairsWork (form) {
  return request({
    url: '/AffFiles/addAffairsWork',
    method: 'post',
    data: form
  })
}

export function addLeaderFiles (form) {
  return request({
    url: '/LeaderFiles/addLeaderFiles',
    method: 'post',
    data: form
  })
}

// export function updateAffair (form) {
//   return request({
//     url: '/LeaderFiles/update',
//     method: 'post',
//     data: form
//   })
// }
export function deleteAffair (id) {
  return request({
    url: `/LeaderFiles/delete/${id}`,
    method: 'delete'
  })
}

export function deleteformWork (id) {
  return request({
    url: `/AffFiles/delete/${id}`,
    method: 'delete'
  })
}

export function getAffair (affairsid, userid) {
  return request({
    url: '/AffFiles/getAffair',
    method: 'get',
    params: {
      affairsid: affairsid,
      userid: userid
    }
  })
}

export function getAllAffair (affairsid) {
  return request({
    url: '/AffFiles/getAllAffairList',
    method: 'get',
    params: {
      affairsid: affairsid
    }
  })
}
